<#assign pojo=oneToManyPojo.getOne()>
<#assign many=oneToManyPojo.getMany()>
<#assign ones=oneToManyPojo.getOnes()>
<#assign fields=pojo.getFilterdPojoFields()>
<#assign declarationName = pojo.importType(pojo.getDeclarationName())>
<#assign declarationNameFirstLetterLower = pojo.importType(pojo.getDeclarationNameFirstLetterLower())>
<#assign realPackageAndClassPath = "${pojo.getRealPackageAndClassPath()}">
<#assign masterid = pojo.getDeclarationNameFirstLetterLower()+"Id">
<!-- start: PAGE TITLE -->
<div ng-controller="${declarationName}Controller">
    <section id="page-title">
        <div class="row">
            <div class="col-sm-6">
                <h1 class="pull-left">EIT/</h1>
                <h1 class="pull-left"><#if pojo.getComment()?exists>${pojo.getComment()}</#if></h1>
            </div>
        </div>
    </section>
    <form role="form" class="form-horizontal" name="Form" id="form1" novalidate ng-submit="form.submit(Form)">
        <fieldset>
<#list fields?chunk(2) as row>
            <div class="form-group">
	<#list row as field>
		<#if field.getIsSampleField()&&field.getIsNotBaseEntiry()>
                <label class="col-sm-2 control-label" for="query_${field.getName()}">
                    <#if field.getComment()?exists>${field.getComment()}<#else>${field.getName()}</#if>
                </label>
                <div class="col-sm-4">
                <#if field.getHtmlType()?exists&&field.getHtmlType()='date'>
                    <p class="input-group">
                        <input type="text" placeholder="请输入<#if field.getComment()?exists>${field.getComment()}<#else>${field.getName()}</#if>" class="form-control" uib-datepicker-popup="yyyy/MM/dd" ng-model="query.${field.getName()}" close-text="Close" is-open="query_${field.getName()}_startOpened" ng-init="query_${field.getName()}_startOpened = false"  ng-click="query_${field.getName()}_startOpened=!query_${field.getName()}_startOpened"/>
                        <span class="input-group-btn">
                            <button type="button" class="btn btn-default" ng-click="query_${field.getName()}_startOpened=!query_${field.getName()}_startOpened">
                                <i class="glyphicon glyphicon-calendar"></i>
                            </button>
                        </span>
                    </p>
                <#else>
                    <input placeholder="请输入<#if field.getComment()?exists>${field.getComment()}<#else>${field.getName()}</#if>" id="query_${field.getName()}" class="form-control" ng-model="query.${field.getName()}">
                </#if>
                </div>
		</#if>
	</#list>
            </div>
</#list>
            <div class="form-group">
                <div class="col-sm-2">
                    <button class="btn btn-primary" type="button" id="btnSearch" ng-click="search${declarationName}()">
                        搜索
                    </button>
                    <button class="btn btn-blue" type="button" id="btnReset">
                        重置
                    </button>
                </div>
             </div>
        </fieldset>
    </form>
    <div class="row margin-bottom-10">
        <div class="col-md-12">
            <button ng-click="add${declarationName}()" class="btn btn-default pull-left">
                新增
            </button>
            <button ng-click="tableParams.sorting({})" class="btn btn-default pull-left">
                export
            </button>
        </div>
    </div>
    <div class="table-responsive margin-bottom-10" style="height: 100%">
        <div ag-grid="gridOptions${declarationName}" class="ag-bootstrap" style="height: 500px"></div>
    </div>
</div>